package com.wondertek.poms.dao.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;

/**
 * @author evan0213
 * @description
 */
@Data
@Entity
@Table(name = "PLAN_MOVE_PRD_INFO")
@DynamicUpdate
@DynamicInsert
@Proxy(lazy = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PlanMovePrdInfo {
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PLAN_MOVE_PRD_INFO_SEQ")
	@SequenceGenerator(name = "PLAN_MOVE_PRD_INFO_SEQ", allocationSize = 1, sequenceName = "PLAN_MOVE_PRD_INFO_SEQ")
	private Long id;

	@Column(name = "OLD_PRD_INFO_ID")
	private Long oldPrdInfoId;

	@Column(name = "NEW_PRD_INFO_ID")
	private Long newPrdInfoId;

	@Column(name = "PRD_CONT_ID")
	private Long prdContId;

	@Column(name = "CONTENT_ID")
	private String contentId;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "PLAN_TIME")
	private Date planTime;

	@Column(name = "STATUS")
	private String status; //0：待移动 1：准备移动 2：移动中 3：移动成功 4:下线 5:处理失败

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_TIME")
	private Date startTime;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_TIME")
	private Date endTime;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME")
	private Date createTime;

	@Column(name = "CREATE_PERSON")
	private String createPerson;

	//描述  1:节目不存在 2：节目已不在原商品包中 3:新产品包不存在或新产品包未发布  4:新产品包和老产品包一样  5:子集或专辑不能直接移动  6:目标产品包中已存在与节目媒资ID相同的节目
	@Column(name = "DESCRIBE")
	private String describe;
}
